There have always been necessary to protect expensive equipment, or in other ways hard to replace equipment, such as ships, especially in troubled times. Particularly small-sized attacks are difficult to stop, such as suicide or terror attacks.
In a home port it is possible to provide satisfactory protection for a ship with different permanent solutions. However, when a ship is not in its home port it is difficult to provide a satisfactory protection for a ship.
Further, it is not necessarily always allowed to set up a permanent installation in a port, due to e.g. diplomatic or environmental reasons. Even if it is possible to set up a permanent installation in a port it is possible that such an approval has been given shortly before a planned visit and a permanent installation usually takes a long time to build.
A further drawback with a permanent installation is that it usually is very expensive.